﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using LTJ.FrameWork;
using LTJ.Control;
using LTJ.Common;

namespace uswinweb.admin
{
    public partial class usermanage_index : AdminPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitDataBind();
            }
        }

        private void InitDataBind()
        {
            if (ViewState["condition"] == null)
            {
                userlist.VirtualItemCount = Users.GetUsersCount("");
                userlist.DataSource = Users.GetUsersByPage(userlist.CurrentPageIndex + 1, userlist.PageSize, "", "");
            }
            else
            {
                userlist.VirtualItemCount = Users.GetUsersCount(ViewState["condition"].ToString());
                userlist.DataSource = Users.GetUsersByPage(userlist.CurrentPageIndex + 1, userlist.PageSize, ViewState["condition"].ToString(), "");
            }

            userlist.DataBind();
        }

        #region Web 窗体设计器生成的代码

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            //grid1.PageIndexChanged += new DataGridPageChangedEventHandler(grid1_PageIndexChanged);
            //grid1.GoToPagerButton.Click += new EventHandler(GoToPagerButton_Click);
            //check.Click += new EventHandler(check_Click);
            //reclick.ServerClick += new EventHandler(reclick_Click);
            //grid1.AllowCustomPaging = true;
            //grid1.TableHeaderName = "体检表信息列表";
            //grid1.Attributes.Add("borderStyle", "0");
            //grid1.DataKeyField = "checkid";
            //grid1.ColumnSpan = 12;
            //grid1.SaveDSViewState = true;
            userlist.AllowCustomPaging = true;
            userlist.DataKeyField = "id";
        }

        #endregion
    }
}